package STUDENT.TRANDAODAIVI.THUVIEN.MODELS;

import java.util.LinkedList;

import STUDENT.TRANDAODAIVI.THUVIEN.IDENTITY.UserInfo;

public class Models2 {
	public LinkedList<UserInfo> community=new LinkedList<UserInfo>();
	
	public void addMember(UserInfo user){
		community.add(user);
	}
	public void showMember(){
		System.out.println("Thanh vien hien co trong thu vien: ");
		System.out.println("");
		for(UserInfo user: community){
			System.out.println("ID: "+user.getId());
			System.out.println("Name: "+ user.getName()+" "+"Type: "+user.getType());
		}
	}
	
	public int checkMember(int id){
		for(UserInfo user:community){
			if(id==user.getId()) return 1;
		};
		return -1;
	}
	public int getSize(){
		return community.size();
	}
}
